package cn.service.Impl;


import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.dao.UserDao;
import cn.entity.User;
import cn.service.UserService;


@Service("userService")
public class UserServiceImpl implements UserService {

	//@Qualifier("userDao")
	@Resource(name="userDao")
	private UserDao dao;

	public void setDao(UserDao dao) {
		this.dao = dao;
		System.out.println("注入参数dao");
	}
	public UserServiceImpl() {
		System.out.println("UserServiceImpl()");
	}
	@Override
	public void addNewUser(User user) {
		// 调用用户DAO的方法保存用户信�?
				dao.save(user);
	}
}
